<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加股票</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection">

    <link rel="stylesheet" href="/gupiao/css/weui.css">
    <link rel="stylesheet" href="/gupiao/css/jquery-weui.css">
    <link rel="stylesheet" href="/gupiao/css/style.css">
    <link rel="stylesheet" href="http://at.alicdn.com/t/font_689900_tgundrn0e1a46lxr.css">

    <style>
        .weui-grid__icon .iconfont{font-size: 28px;color:#999;}

        .release-cont .weui-cells{margin-top: 0;}
        .bBeforeBox{padding:0;}
        .bBeforeBox label{width: 50%;}
        .bBeforeBox .bBefore:before{border:0;}
        .qrfb-btn{margin:20px 5px;}
    </style>
</head>
<body class="back1">


<div class="index-top-fix">
    <a href="{:url('index/gupiao.mycenter/myCenter')}" class="iconfont icon-left- left"></a>
    <p class="title">添加股票</p>
</div>

<div class="mt50"></div>

<form action="" method="post" id="add">
    <div class="index-box release-cont">
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="xingchengz">
                        <span class="f15 open-popup">股票名称</span>
                        <input type="text" class="font1" name="name" placeholder="请输入股票名称" id="gpName">
                    </p>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="xingchengz">
                        <span class="f15 open-popup">股票缩写</span>
                        <input type="text" class="font1" name="short_name" placeholder="请输入股票缩写" id="gpshort_name">
                    </p>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="xingchengz">
                        <span class="f15 open-popup">股票代码</span>
                        <input type="text" class="font1" name="code" placeholder="请输入股票代码" id="gpCode">
                    </p>
                </div>
            </div>

            <div class="weui-cell">
                <div class="weui-cell__bd">
                    <p class="xingchengz">
                        <span class="f15 open-popup">点评价格</span>
                        <input type="text" name="price"  class="font1" placeholder="请输入点评价格" id="gpPrice">
                    </p>
                </div>
            </div>

            <div class="weui-cell weui-cells_checkbox bBeforeBox">

                <label class="weui-cell weui-check__label" for="s13">
                    <div class="weui-cell__hd">
                        <input type="radio" class="weui-check" name="is_recomm" id="s13" value="1">
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p class="f15">推荐</p>
                    </div>
                </label>
                <label class="weui-cell weui-check__label bBefore" for="s14" style="border:0;">
                    <div class="weui-cell__hd">
                        <input type="radio" name="is_recomm" class="weui-check" id="s14" value="0" checked="checked">
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p class="f15">不推荐</p>
                    </div>
                </label>
            </div>
            <div class="weui-cell weui-cells_checkbox bBeforeBox" style="display:none;">

                <label class="weui-cell weui-check__label" for="s15">
                    <div class="weui-cell__hd">
                        <input type="radio" class="weui-check" name="is_show" id="s15" value="1" checked="checked">
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p class="f15">显示</p>
                    </div>
                </label>

                <label class="weui-cell weui-check__label bBefore" for="s16" style="border:0;">
                    <div class="weui-cell__hd">
                        <input type="radio" name="is_show" class="weui-check" id="s16" value="0">
                        <i class="weui-icon-checked"></i>
                    </div>
                    <div class="weui-cell__bd">
                        <p class="f15">不显示</p>
                    </div>
                </label>
            </div>
        </div>
    </div>
</form>

<div class="release-bottom">
    <a href="javascript:;" onclick="login()" class="weui-btn qrfb-btn">添加</a>
</div>

</body>
</html>

<script src="/gupiao/js/jquery.min.js"></script>
<script src="/gupiao/js/jquery-weui.min.js"></script>

<script>
    // 添加股票
    function login() {
        $.ajax({
            type: "POST",                       //方法类型
            dataType: "json",                   //预期服务器返回的数据类型
            url: "{:url('gupiao.gupiao/gupiaoAdd')}" ,        //url
            data: $('#add').serialize(),
            success: function (res) {
                if (res.code == 200) {

                    alert(res.dest);

                    setTimeout(function () {
                        location.href ="{:url('index/gupiao.lists/lists')}?type=remark";
                    });

                } else {
                    alert(res.dest);
                }
            },
            error : function() {
                alert("异常！");
            }
        });
    }
</script>

